<include file="__THEME__/header" />
<script type="text/javascript" src="__PUBLIC__/js/jquery.form.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/weibo.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery.autocomplete.js"></script>
<div class="content_holder">
<div class="content W_bg"><!-- 内容 begin  --> 
  <include file="__THEME__/apps" />
  <div class="wrap_index_r">
    <div class="mainbox">
      <div class="mainbox_R"> 
          {:W('Visitor', array('id'=>$mid))}
          {:W('RelatedUser',array('async'=>1))}
		  <!-- 签到 by vipin-->
		  {:Addons::hook('home_index_right_top')}
        <div class="right_box">
          <h2><a href="javascript:void(0)" onclick="$('.quick_win').show()" class="right" style="font-size:12px;font-weight:400">添加</a>关注的话题</h2>
          <div style="display:none;" class="quick_win">
            <div class="alR mb5"><a href="javascript:void(0)" onclick="$('.quick_win').hide()" class="del" title="关闭"></a></div>
            <p>
              <input type="text" class="text" name="quick_name" style=" width:80px;"/>
              <input type="button" onclick="addFollowTopic()" value="保存" class="btn_b" />
            </p>
            <p class="cGray2">请添加想关注的话题</p>
          </div>
          <ul class="topic_list" rel="followTopicArea">
            <volist id="vo" name="followTopic">
              <li onmouseover="$(this).find('.del').show()" onmouseout="$(this).find('.del').hide()"><a class="del right" style="display:none" title="删除" href="javascript:void(0)" onclick="deleteFollowTopic(this,'{$vo.topic_id}')"></a><a href="{:U('home/user/topics',array('k'=>urlencode($vo['name'])))}" title="{$vo.name}">{$vo.name}</a></li>
            </volist>
          </ul>
        </div>
        <div class="right_box">
          {:W('HotTopic', array('type'=>'recommend'))}
          {:W('HotTopic', array('type'=>'auto'))}
        </div>
		<volist name="ts['ad']['right']" id="vo">
		<div class="ad_right"><div class="ke-post">{$vo.content}</div></div>
		</volist>
      </div>
      <div class="mainbox_C">
      <div class="clearfix">
        <php>if($announcement['is_open'] && !empty($announcement['content'])) {</php>
        <div class="iine_warning" style="padding: 5px; *display: inline-block" id="announcement"><a class="del right" href="javascript:void(0);" onclick="close_announcement();"></a>{$announcement['content']}</div>
        <php>}</php>
        <switch name="ACTION_NAME">
          <case value="index">
            {:Addons::hook('home_index_middle_top')}
	        <div class="talkBox send_weibo" style="height:180px">
	          <form method="post" action="{:U('weibo/operate/publish')}" id="miniblog_publish" oncomplete="false">
	            <input type="hidden" name="publish_type" value="0">
	            <h2>
	              <div class="wordNum numObj">你还可以输入<strong id="strconunt">{$GLOBALS['ts']['site']['length']}</strong>字</div>
	              <!--<span>快来说点什么吧……</span>-->
	              <div class="title"><img src="../Public/images/show_img.jpg" /></div>
	            </h2>
	            <div class="cntBox">
	              <textarea name="content" id="content_publish" cols="" rows="" class="contentObj"></textarea>
	              <div class="txtShadow" style="z-index:-1000"></div>
	            </div>
	            <div class="funBox">
	              <input type="button" disabled="true" error="发布失败" class="btn_big_disable hand buttonObj right" value="" id="publish_handle"  />
	                <php>if(Addons::requireHooks("home_index_middle_publish")){</php>
	                <div class="right" style="padding-bottom:5px; cursor:hand;width:50px; cursor:pointer"  onclick='weibo.showAndHideMenu("Sync", this, "", "");'>
                        同步<a href="#" class="ico_sync_on"></a>
                    </div>
                    <div id="Sync" style="display:none;position:absolute;right:80px;top:30px;z-index:9999">
                        <div class="topic_app"></div>
                        <div class="pop_inner">
                                    {:Addons::hook('home_index_middle_publish')}
                        </div>
                    </div>
                    <php>}</php>
	              <div id="publish_type_content_before" class="left">
	                {:Addons::hook('home_index_middle_publish_type',array('position'=>'index'))}
	              </div>
	            </div>
	          </form>
	        </div>

		  <volist name="ts['ad']['middle']" id="vo">
          <div class="ad_c1"><div class="ke-post">{$vo.content}</div></div>
		  </volist>
            <div class="tab-menu"><!-- 切换标签 begin  -->
              <ul>
				<php>if($show_feed==0){</php>
				    <volist name="weibo_menu" id="vo">
                        <li><a id="feed_all_item" rel="all" class="<php>if($_GET['weibo_type'] == $key) echo "on"; </php> feed_item" href="{:U('home/user/index',array('follow_gid'=>$group_now['follow_group_id'],'weibo_type'=>$key))}"><span>{$vo}</span></a></li>
                    </volist>
				<php>}</php>
              </ul>
            </div>
            <div class="MenuSub ">
                <php>$type = $_GET['weibo_type'];</php>
	        <div class="right"><input type="button" onclick="setFollowGroupTab()" class="N_but" value="创建分组" style="margin:2px 5px 0 0;"></div>
		        <div class="left wn">
		          <a href="{:U('home/user/index',array('weibo_type'=>$type))}" <php>if(!isset($_GET['follow_gid'])) echo 'class="on"';</php>><span>所有分组</span></a>
		          <a href="{:U('home/user/index',array('weibo_type'=>$type,'follow_gid'=>0))}" <php>if(isset($_GET['follow_gid']) && 0 == $_GET['follow_gid']) echo 'class="on"';</php>><span>未分组</span></a>
		          <volist id="fg" name="group_list_1">
		            <a href="{:U('home/user/index',array('weibo_type'=>$type,'follow_gid'=>$fg['follow_group_id']))}" <if condition="$_GET['follow_gid'] eq $fg['follow_group_id']"><php>$gtitle=$fg['title'];</php>class="on" id="current_follow_group"</if>>{$fg['title']}</a>
		          </volist>
			    </div>
				<if condition="$group_list_2">
		          <div onmouseout="this.className='feeds_sift'" onmouseover="this.className='feeds_sift_hover'" class="feeds_sift"><a href="#"><span >更多</span><span class="more"></span></a>
		            <div class="feeds_sift_box">
		              <span id="followGroup">
			            <volist id="fg" name="group_list_2">
			              <a href="{:U('home/user/index',array('weibo_type'=>$type,'follow_gid'=>$fg['follow_group_id']))}" <if condition="$_GET['follow_gid'] eq $fg['follow_group_id']"><php>$gtitle=$fg['title'];</php></if>>{$fg['title']}</a>
			            </volist>
			          </span>
			        </div>
				  </div>
				</if>
	        </div>
	        <if condition="intval($gid)"><div class="alR"><a href="javascript:void(0);" onclick="setFollowGroupTab('{$gid}')" ><span style="color:#FF0000;"></span>修改分组</a> <a href="{:U('weibo/FollowGroup/deleteGroup',array('gid'=>$gid))}" onclick="if(confirm('确定要删除“{$gtitle}”分组吗？此分组下的人不会被取消关注。'))return ture;return false;" ><span style="color:#FF0000;">×</span>删除分组</a></div></if>
          </case>
          <case value="atme">
            <div class="tab-menu">
              <ul>
                <li><a href="###" class="on"><span>提到我的</span></a></li>
              </ul>
            </div>
          </case>
          <case value="collection">
            <div class="tab-menu">
              <ul>
                <li><a href="###" class="on"><span>我收藏的</span></a></li>
              </ul>
            </div>
          </case>
        </switch>
        <div class="feedBox">
          <div id="countNew"> </div>
                {:W('WeiboList', array('mid'=>$mid, 'list'=>$list['data'], 'insert'=>1))}
		  <php>if($show_feed || ACTION_NAME!='index'){</php>
		  	<p class="page">{$list.html}</p>
		  <php>}else{</php>
          	<p class="moreFoot"><a id="loadMoreDiv" href="javascript:void(0)"><span class="ico_morefoot"></span>更多</a></p>
		  <php>}</php>
        </div>
        
        </div>
        <div class="c"></div>
      </div>
    </div>
  </div>
</div>
</div>
<!-- 内容 end --> 

<include file="__THEME__/footer" /> 
<script>
function close_announcement() {
	$('#announcement').hide('slow');
	$.post("{:U('home/User/closeAnnouncement')}",{},function(res){});
}
var weibo = $.weibo({
      sinceId: parseInt('{$sinceId}'),
      <php>if(ACTION_NAME=="index"){</php>
      timeStep : 60000,
      initForm:true,
      <php>}</php>
      lastId:parseInt('{$lastId}'),
      show_feed:parseInt('{$show_feed}'),
      follow_gid:parseInt('{$follow_gid}'),
      gid:parseInt('{$gid}'),
      weiboType:parseInt('{$type}'),
      type:parseInt('{$indexType}'),
      typeList:{
          WEIBO:parseInt(<php>echo UserAction::INDEX_TYPE_WEIBO;</php>),
          GROUP:parseInt(<php>echo UserAction::INDEX_TYPE_GROUP;</php>),
          ALL:parseInt(<php>echo UserAction::INDEX_TYPE_ALL;</php>)
      }
});
</script> 
{:Addons::hook('weibo_js_plugin')}